package com.wangshouyu.mp.pay.v3.transactions;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 交易场景
 * @date 2020/8/14 9:39
 */
public class TransactionsSceneInfo implements Serializable {

    /**
     * 用户终端IP
     */
    @SerializedName(value = "payer_client_ip")
    @JsonProperty(value = "payer_client_ip")
    @JSONField(name = "payer_client_ip")
    private String payerClientIp;

    /**
     * 商户端设备号
     */
    @SerializedName(value = "device_id")
    @JsonProperty(value = "device_id")
    @JSONField(name = "device_id")
    private String deviceId;

    /**
     * 商户门店信息
     */
    @SerializedName(value = "store_info")
    @JsonProperty(value = "store_info")
    @JSONField(name = "store_info")
    private TransactionsStoreInfo storeInfo;

    /**
     * H5场景信息
     */
    @SerializedName(value = "h5_info")
    @JsonProperty(value = "h5_info")
    @JSONField(name = "h5_info")
    private TransactionsH5Info h5Info;

    public String getPayerClientIp() {
        return payerClientIp;
    }

    public void setPayerClientIp(String payerClientIp) {
        this.payerClientIp = payerClientIp;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public TransactionsStoreInfo getStoreInfo() {
        return storeInfo;
    }

    public void setStoreInfo(TransactionsStoreInfo storeInfo) {
        this.storeInfo = storeInfo;
    }

    public TransactionsH5Info getH5Info() {
        return h5Info;
    }

    public void setH5Info(TransactionsH5Info h5Info) {
        this.h5Info = h5Info;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TransactionsSceneInfo that = (TransactionsSceneInfo) o;
        return Objects.equals(payerClientIp, that.payerClientIp) &&
                Objects.equals(deviceId, that.deviceId) &&
                Objects.equals(storeInfo, that.storeInfo) &&
                Objects.equals(h5Info, that.h5Info);
    }

    @Override
    public int hashCode() {
        return Objects.hash(payerClientIp, deviceId, storeInfo, h5Info);
    }

    @Override
    public String toString() {
        return "TransactionsSceneInfo{" +
                "payerClientIp='" + payerClientIp + '\'' +
                ", deviceId='" + deviceId + '\'' +
                ", storeInfo=" + storeInfo +
                ", h5Info=" + h5Info +
                '}';
    }
}
